# R script for Kim-Manger: Hubs of Governance
# Estimated using R 3.1.0
# and RSiena 1.1-276 as the newer versions of RSiena are
# not yet compatible with the cluster package
# RSiena 1.1-276 is included in the replication files
#
# set the working directory to where you have unzipped the data files
setwd("~/Documents/Projects/HubsofGovernance/1-SienaAnalysis")
# If you have a Windows computer, try this
install.packages("RSiena_1.1-276.zip", repos = NULL)
# for Mac users, the following is correct
# install.packages("RSiena_1.1-276.tgz", repos = NULL, type = 'source')
require(RSiena)
# source file to read in the data
source("HubsOfGovernanceLoadData.R")
source("HubsOfGovernanceCreateVariables.R")
# Define the kind of non-directed model
model33 <- sienaModelCreate(projname = "HubsofGovernanceReplication", useStdInits = TRUE, modelType = 3,
                            n3=3000, firstg = 0.4, seed=12345, dolby=FALSE)
#
# To produce the results in the paper (models 1 and 2) and in the appendix
# (the other models), comment out one of these lines at a time and run the model
# Note that you need to re-load the variables and effects parameters by running
# the current replication script before you
# try the next model, otherwise the effects settings are "carried over"
# and the model just gets more saturated with variables and effects
#
source("HubsOfGovernance-Model1.R")
#source("HubsOfGovernance-Model2.R")
#source("HubsOfGovernance-TotalFDImodel.R")
# source("HubsOfGovernance-BITsmodel.R")
#source("HubsOfGovernance-BITsEUmodel.R")
#source("HubsOfGovernance-CommonLegalModel.R")
#source("HubsOfGovernance-CommonLanguage.R")
multians4 <- siena07(model33,
                     data = multiPtaData,
                     effects = multiPtaEff,
                     #                     returnDeps=TRUE,
                     batch=TRUE,
                     nbrNodes = 4,
                     useCluster = TRUE)




